import { ref } from 'vue'
import { NetTool, DataColumn } from '../../packages/index'
import axios from '/@/request/http.js'
export const netUtil = new NetTool(axios)
export const DemoColumns = ref<DataColumn[]>([
    {
        title: '标题',
        fieldName: 'title',
        required: true,
    },
    {
        title: '内容',
        required: true,
        fieldName: 'itemDesc',
        isRichText: true,
        useViewBtn:true
        // isHideInList: true
    },
    {
        title: '是否公开',
        fieldName: 'isPublic',
        useSwitch: true,

    },
    {
        title: '浏览',
        fieldName: 'linkUrl',
        isFile: true,
        isHideInForm: true,

    },

    {
        title: '图片组',
        fieldName: 'imgList',
        isFile: true,
        isImg: true,
        showInDetail: true,
        isHideInForm: true,
        isHideInList: true

    },
    {
        title: '类型',
        fieldName: 'demoType',
        placeholder: '选择类型',
        options: []
    },
    {
        title: '作品封面(100kb内)',
        fieldName: 'coverPicPath',
        isHeadImg: true,
        isHideInList: true,
        maxSize: 100 * 1024,
        isImg: true,
        isFile: true,
        required: true,
        fileLimit: 1,
        // isHideInList: true
    },
    {
        title: '音频视频(5MB内)',
        fieldName: 'videoOrAudioPath',
        isHideInList: true,
        maxSize: 5 * 1024 * 1024,
        isFile: true,
        fileLimit: 1,
    },
    {
        title: '发表时间',
        fieldName: 'createdTime',
        isHideInForm: true,
        isDate: true,
        needShowTime: true,
    },
]);

export const QuestionGroupColumns = ref<DataColumn[]>([
    {
        title: '标题',
        fieldName: 'title',
        required: true,
        placeholder: '必须输入',
    },
    {
        title: '类型',
        fieldName: 'groupType',
        required: true,
        placeholder: '选择题组类型',
        options: []
    },
    {
        title: '使用全部',
        fieldName: 'useAll',
        useSwitch: true,
        isHideInList: true
    },

    {
        title: '是否公开',
        fieldName: 'isPublic',
        useSwitch: true,
        isHideInList: true
    },

    {
        title: '题量题分',
        fieldName: 'brushSetting',
        useComponent: true,
        isHideInList: true
    },

    {
        title: '所属科目',
        fieldName: 'subjectID',
        placeholder: '选择科目',
        options: [],
        isHideInList: true
    },
    {
        title: '科目',
        fieldName: 'subjectName',
        isHideInForm: true,
    },
    // {
    //     title: '题量(刷题)', //是否应该根据刷题数来赋分？平均给分，还是按题型给分？
    //     fieldName: 'useQuestionCount',
    //     dataType: 'number',
    //     isHideInList: true
    // },
    {
        title: '可刷次数', //是否应该根据刷题数来赋分？平均给分，还是按题型给分？
        fieldName: 'canBrushCount',
        dataType: 'number',
        isHideInList: true
    },
    {
        title: '总分',
        fieldName: 'total_score',
        dataType: 'number',
        isHideInList: true
    },
    {
        title: '及格分数',
        fieldName: 'pass_score',
        dataType: 'number',
        isHideInList: true
    },
    {
        title: '启用时间',
        fieldName: 'canStartTime',
        dataType: 'datetime',
        isDate: true,
    },
    {
        title: '关闭时间',
        fieldName: 'closedTime',
        dataType: 'datetime',
        isDate: true,
        isHideInList: true,
    },
    {
        title: '状态',
        fieldName: 'useState',
        isHideInForm: true,
    },
    {
        title: '限时(分钟)',
        fieldName: 'limitMinutes',
        dataType: 'number',
        isHideInList: true
    },
    {
        title: '查看答案',
        fieldName: 'canShowAnswer',
        useSwitch: true,
        isHideInList: true
    },
    {
        title: '显示录题者',
        fieldName: 'showQAuthor',
        useSwitch: true,
        isHideInList: true
    },

    {
        title: '题目列表',
        fieldName: 'question_list_json',
        useComponent: true,
        isHideInList: true
    },
]);

export const JobColumns = ref<DataColumn[]>([
    {
        title: '开始时间',
        isDate: true,
        needShowTime: true,
        fieldName: 'begin_time',

    },
    {
        title: '分数',
        fieldName: 'score',
    },
    {
        title: '做题详情',
        fieldName: 'sub_scores',
        isHideInList: true
    },
]);

//这个是监控列
export const QuizJobColumns = ref<DataColumn[]>([
    {
        title: '学号',
        fieldName: 'stuNum',
    },

    {
        title: '考场座位',
        fieldName: 'seatNum',
    },
    {
        title: '姓名',
        fieldName: 'realName',
    },
    {
        title: '班级',
        fieldName: 'className',
    },
    // {
    //     title: '状态',
    //     fieldName: 'onlineState',
    // },
    {
        title: '登录IP',
        fieldName: 'clientIP',
    },
    {
        title: '更新时间',
        isDate: true,
        needShowTime: true,
        fieldName: 'lastUpdatedTime',

    },

    {
        title: '状态',
        fieldName: 'state',
    },
    {
        title: '得分',
        fieldName: 'score',
        isHideInList: true,
    },
])

export const RankingJobColumns = ref<DataColumn[]>([
    {
        title: '排名',
        fieldName: 'rankSeq',
        isHideInForm: true,
    },
    {
        title: '学号',
        fieldName: 'stuNum',
    },
    {
        title: '姓名',
        fieldName: 'realName',
    },
    {
        title: '班级',
        fieldName: 'className',
    },

    {
        title: '成绩',
        fieldName: 'score',
    },
])
